home *** CD-ROM | disk | FTP | other *** search
- #include <mio.h>
- #include <mgr.h>
-
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- int main ()
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- {
- MImage screen (MAXX,MAXY);
-
- initgraph();
- keyb.KeyFlush(); // Clear the keyboard buffer
-
- while (!keyb.KeyPress())
- {
- setcolor (random (256));
- line (random (320), random(200),random (320), random(200));
- }
- keyb.KeyFlush();
-
- screen.Get (0,0);
- screen.Save ("screen.pix");
- screen.Clear();
-
- cleardevice();
- setcolor (65);
- outtextxy (50,50, "The image has been saved in 'screen.pix'");
- outtextxy (70,70, "Press any key to restore...");
-
- while (!keyb.KeyPress());
-
- screen.Load ("screen.pix");
- screen.Put (0,0);
-
- keyb.KeyFlush();
- while (!keyb.KeyPress());
-
- closegraph();
- return (0);
- }
-